package juc.c_001;/*
   Talk is cheap. Show me the code.
 */

/**
 * @Description
 * @Date 2021/6/6
 * @Author liudl
 */
public class T7  {
    public synchronized void m1() {
        System.out.println("m1 Start...");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("m1 End...");
    }

    public void m2(){
        System.out.println(Thread.currentThread().getName()+"   m2   ");
    }

    public static void main(String[] args) {
        T7 t7 = new T7();
        new Thread(t7::m1,"t1").start();
        new Thread(t7::m2,"t2").start();
    }
}
